<?php
/* $Id$ */
use Buan\Config;
use Buan\UrlCommand;
$urlRoot = Config::get('ext.Scribble.urlRoot');
ScribbleAdminView::getGlobalView()->addStylesheets("{$urlRoot}/css/scribble/page/edit.select-template.css");
ScribbleAdminView::getGlobalView()->addJavascripts("{$urlRoot}/js/scribble/page/edit.select-template.js");
?>

<div class="head">
	<h1>Pages</h1>
	<h2>Select Templates</h2>
</div>

<div class="float-wrapper">
	<input type="hidden" id="templates" value="<?php $this->html->e(json_encode($templates)); ?>" />

	<?php if($showOuterListing): ?>
		<h3 class="st-head"><strong>1</strong><span>Select an outer template</span></h3>
		<h3 class="st-head st-head-outer"><strong>2</strong><span>Select an inner template</span></h3>
	<?php endif; ?>

	<div id="templates-container" class="float-wrapper<?php echo $showOuterListing ? ' twocol' : ''; ?>">
		<?php if($showOuterListing): ?>
			<ul id="templates-outer" class="templates-list"></ul>
		<?php endif; ?>
		<ul id="templates-inner" class="templates-list"></ul>
	</div>

	<form id="form-select" method="get" action="<?php $this->html->eUrl(UrlCommand::createUrl('scribble', 'page', $page->isInDatabase() ? $page->id : 'create')); ?>">
		<input type="hidden" name="t" id="template-selection" value="<?php $this->html->e($templateSelection); ?>" />
		<button class="disabled submit" type="submit" id="btn-select" value="Go" disabled="disabled">Go</button>
	</form>
</div>

